/**
 *
 */
package org.whuims.pois.dao;

import org.whuims.pois.hibernate.BaseDao;

/**
 * 登陆时数据交流对象
 *
 * @author herochen
 *         <p/>
 *         version 2010-9-14
 */
public class LoginDao {
    BaseDao baseDao = new BaseDao();

    /**
     * 判定用户名和密码是否正确
     */
    public boolean validate(String user, String password) {
        int count = baseDao.getTotalCounts("from User where user = ? and password =?", user, password);
        if (count > 0) {
            return true;
        } else {
            return false;
        }
    }

}
